<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      width: 100px;
      height: 100px;
      margin: 0 auto;
      margin-top: 10px;
    }

    .box1 {
      background-color: rgb(96, 21, 96);
    }

    .box2 {
      background-color: rgb(211, 140, 211);
    }

    .box3 {
      /* 相对定位  相对的是自身的位置*/
      position: relative;
      left: 100px;
      top: 100px;
      background-color: rgb(194, 9, 194);
    }

    .box4 {
      background-color: rgb(128, 77, 128);
    }
  </style>
</head>

<body>
  <div class="box1"></div>
  <div class="box2"></div>
  <div class="box3"></div>
  <div class="box4"></div>
</body>

</html>